// 车辆管理相关接口
import instance from '@/utils/request'

// 获取车辆类型信息列表
export function getVehicleList() {
  return instance({
    url: '/manager/truckType/simple',
    method: 'get'
  })
}

// 添加车辆类型
export function addVehicleList(data) {
  return instance({
    url: '/manager/truckType',
    method: 'post',
    data: {
      allowableLoad: data.allowableLoad,
      allowableVolume: data.allowableVolume,
      measureHigh: data.measureHigh,
      measureLong: data.measureLong,
      measureWidth: data.measureWidth,
      name: data.name
    }
  })
}

// 删除车辆类型
export function deleteVehicleList(id) {
  return instance({
    url: `/manager/truckType/${id}`,
    method: 'delete'
  })
}

// 获取车辆类型分页数据
export function getPagingVehicleList(params) {
  return instance({
    url: '/manager/truckType/page',
    method: 'get',
    params
  })
}

// 更新车辆类型
export function putUpdateVehicleList(id) {
  return instance({
    url: `/manager/truckType/${id}`,
    method: 'put'
  })
}

// 获取车辆类型详情
export function getDetailVehicleList(id) {
  return instance({
    url: `/manager/truckType/${id}`,
    method: 'get'
  })
}

// 停用车辆
export function stopCarApi(id) {
  return instance({
    url: `/manager/disable/${id}`,
    method: 'put'
  })
}
// 启用车辆
export function starCarApi(id) {
  return instance({
    url: `/manager/enable/${id}`,
    method: 'put'
  })
}
